Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update subscriptions view to display video publish time in relative form even fetched via RSS #3216

Merged

Conversation

PikachuEXE
Copy link
Collaborator

Update subscriptions view to display video publish time in relative form even fetched via RSS

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

N/A

Description

Currently subscriptions view displays video publish times in absolute form when Fetch Feeds from RSS enabled
This PR updated it to display time in relative form like when it's disabled

Screenshots

image
image

Testing

  • Enable Fetch Feeds from RSS
  • (Optional) Change locale to non English (maybe test once with English first)
  • Refresh Subscriptions

Desktop

  • OS: MacOS
  • OS Version: 12.6.2
  • FreeTube version: 69bec40

Additional context

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) February 24, 2023 02:58
@github-actions github-actions bot added PR: dependencies Pull requests that update a dependency file PR: waiting for review For PRs that are complete, tested, and ready for review labels Feb 24, 2023
@PikachuEXE PikachuEXE force-pushed the feature/rss-feed-relative-time branch from d07a1e3 to 882441d Compare February 24, 2023 10:50
Comment on lines 430 to 441
let timeDiffFromNow = ((now - this.data.publishedDate) / 1000) / 60
let timeUnit = 'minute'

if (timeDiffFromNow > 60) {
timeDiffFromNow /= 60
timeUnit = 'hour'
}

if (timeUnit === 'hour' && timeDiffFromNow > 24) {
timeDiffFromNow /= 24
timeUnit = 'day'
}
Copy link
Member

@absidue absidue Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add support for seconds (it's rare but happens) as well as months and years?

I'm subscribed to one channel that hasn't uploaded in 3 years but i'm subscribed to keep it easily accessible.

@PikachuEXE PikachuEXE removed the PR: dependencies Pull requests that update a dependency file label Feb 26, 2023
Also add more code comments
Also fix issue of display after switching back from another view
@PikachuEXE
Copy link
Collaborator Author

Seconds (hardcode time diff to 37 seconds)
image

Month:
image

Year:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@FreeTubeBot FreeTubeBot merged commit 4ad3ec2 into FreeTubeApp:development Feb 27, 2023
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants